fillRange

Fills a range as replacement for an image size.

Can be used to initialize an image with a set color.

  1. auto fillRange(Image image, Color value)
  2. auto fillRange(IRImage image, Color value)
    @nogc nothrow @safe
    fillRange
    (
    IRImage
    ET = ElementType!IRImage
    Color
    )
    (
    IRImage image
    ,
    Color value
    )
    if (
    isPixelRange!IRImage &&
    is(ET == PixelPoint!Color)
    )

Parameters

image IRImage

An input range for color to fill as

value Color

The color to fill as

Return Value

Type: auto

An input range that returns value for each pixel in the image

Examples

SwappableImage!RGB8 image = ...;
foreach(pixel; image.fillRange(RGB8(77, 82, 31))) {
    writeln(pixel, " at x:", pixel.x, " y:", pixel.y);
    writeln("\tImage has size width:", pixel.imageWidth, " height:", pixel.imageHeight);
}

Meta